home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bas_int1.zip / BRIGHTBG.BAS < prev    next >
BASIC Source File  |  1991-06-24  |  3KB  |  113 lines

  1. '======================================================================
  2. ' Quick Basic Forum
  3. '   Date : 20-Jun-91
  4. '   From : Monte Ferguson
  5. 'Subject : Bright **backgrounds**
  6.  
  7. 'You can fiddle with the video modes to convert the blink bit into
  8. 'another bit of color attribute for the background.  With EGA and VGA
  9. 'there is a BIOS call that will do this... with CGA you need to talk to
  10. 'the chips.  Keep in mind that when you flip this bit you no longer have
  11. '*blinking* characters. Blinking black on brown background will convert
  12. 'to non-blinking black on a yellow background.
  13.  
  14. 'NOTE that you use a different method for EGA/VGA than you use for CGA...
  15.  
  16. 'Note that this routine uses CALL INTERRUPT
  17. '=========================================================================
  18.  
  19. DEFINT A-Z
  20.  
  21. TYPE RegType
  22.    AX AS INTEGER
  23.    BX AS INTEGER
  24.    CX AS INTEGER
  25.    DX AS INTEGER
  26.    BP AS INTEGER
  27.    SI AS INTEGER
  28.    DI AS INTEGER
  29.    FLAGS AS INTEGER
  30.    DS AS INTEGER
  31.    ES AS INTEGER
  32. END TYPE
  33.  
  34.  
  35. DIM SHARED Inregs AS RegType, Outregs AS RegType
  36. DEF SEG = &H40             ' Set Segment to Video BIOS data
  37. VidReg = 4 + PEEK(&H63) + PEEK(&H64) * 256  ' Get the video port to use
  38.  
  39. SCREEN 0, 0, 0
  40. WIDTH 80, 25
  41.  
  42.  
  43. CLS
  44. FOR bg = 0 TO 7
  45.    FOR fg = 0 TO 31
  46.       LOCATE bg + 1, fg * 2 + 1
  47.       COLOR fg, bg
  48.       PRINT "**";
  49.    NEXT fg
  50. NEXT bg
  51. COLOR 7, 0
  52.  
  53. LOCATE 10, 1
  54. PRINT STRING$(80, "═");
  55. LOCATE 11, 1
  56. PRINT "BLINKOID Blink Attribute Toggle Tester    21-Apr-90  Monte Ferguson"
  57. PRINT " Note: Nothing above the line changes."
  58. PRINT "Keys:"
  59. PRINT "1 - Int 10.10.03 function BLINK BIT off (for EGA/VGA)"
  60. PRINT "2 - Int 10.10.03 function BLINK BIT on  (for EGA/VGA)"
  61. PRINT "3 - CRT Mode Control Reg  BLINK BIT off (for CGA)"
  62. PRINT "4 - CRT Mode Control Reg  BLINK BIT on  (for CGA)"
  63. PRINT "Esc - Quit"
  64.  
  65. LOCATE 18, 40
  66. PRINT "I read the video control register as "; HEX$(VidReg)
  67.  
  68.  
  69.  
  70. DO
  71.    I$ = ""
  72.    DO WHILE I$ = ""
  73.       I$ = INKEY$
  74.    LOOP
  75.    SELECT CASE I$
  76.       CASE CHR$(27)
  77.          EXIT DO
  78.       CASE "1"
  79.          Inregs.AX = &H1003
  80.          Inregs.BX = 0
  81.          CALL interrupt(&H10, Inregs, Outregs)
  82.       CASE "2"
  83.          Inregs.AX = &H1003
  84.          Inregs.BX = 1
  85.          CALL interrupt(&H10, Inregs, Outregs)
  86.       CASE "3"
  87.          RegStat = PEEK(&H65)
  88.          LOCATE 20, 40
  89.          PRINT "Video Register was "; HEX$(RegStat);
  90.          RegStat = RegStat AND &HDF
  91.          OUT VidReg, RegStat
  92.          POKE &H65, RegStat
  93.          PRINT ", is now "; HEX$(RegStat); "   "
  94.       CASE "4"
  95.          RegStat = PEEK(&H65)
  96.          LOCATE 20, 40
  97.          PRINT "Video Register was "; HEX$(RegStat);
  98.          RegStat = RegStat OR &H20
  99.          OUT VidReg, RegStat
  100.          POKE &H65, RegStat
  101.          PRINT ", is now "; HEX$(RegStat); "   "
  102.       CASE "0"
  103.          VidReg = &H3D4
  104.          LOCATE 19, 40
  105.          PRINT "VidReg is now "; HEX$(VidReg)
  106.       CASE ELSE
  107.    END SELECT
  108. LOOP
  109.  
  110. CLS
  111. END
  112.  
  113.